//
//  WYRFriendGroup.m
//  10-21-快速搭建框架
//
//  Created by zzn on 2016/11/8.
//  Copyright © 2016年 lkx0. All rights reserved.
//

#import "WYRFriendGroup.h"
#import "WYRFriend.h"
@implementation WYRFriendGroup

//对象初始化方法
-(instancetype)initWithDict:(NSDictionary *)dict{
    if (self=[super init]) {
        [self setValuesForKeysWithDictionary:dict];
        
        //将好友字典数组转成好友模型数组
        NSMutableArray *arrayModels=[NSMutableArray array];
        
        for (NSDictionary * dict in _friends) {
            WYRFriend *model=[WYRFriend friendWithDict:dict];
            [arrayModels addObject:model];
            
        }
        
        _friends=arrayModels;
    }
    return self;
}

//类初始化方法
+(instancetype)friendGroupWithDict:(NSDictionary *)dict{
    return [[self alloc]initWithDict:dict];

}


@end
